    function consultaGrupos(){
    var email="email@email.com";//ESTO HAY QUE PILARLO DE LA COOKIE
    
    if (email){
    $.ajax({
                type: "GET",
                url: "cgis/consultaGrupos.cgi", // URL of the Perl script
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                // send username and password as parameters to the Perl script
                data: "email=" + email,
                // script call was *not* successful
               error: function(XMLHttpRequest, textStatus, errorThrown) { 
                   
                   $('div#grupoResult').text("responseText: " + XMLHttpRequest.responseText 
                        + ", textStatus: " + textStatus 
                        + ", errorThrown: " + errorThrown);
                    $('div#grupoResult').addClass("error");
                   
                    var respuesta=XMLHttpRequest.responseText;
                    $('div#grupoResult').text(respuesta[50]);
                }, // error 
                // script call was successful 
                // data contains the JSON values returned by the Perl script 
                success: function(data){
                    if (data.error) { // script returned error
                        $('div#grupoResult').text("data.error: " + data.error);
                        $('div#grupoResult').addClass("error");
                     } // ifd
                    else { // login was successful
                        $('form#grupoResult').hide();
                        $('div#grupoResult').text("Te has registrado correctamente, vuelve a la página inicial y logéate");
                        $('div#grupoResult').addClass("success");
                    } //else
                } // success
            }); // ajax
}else{alert("ES NECESARIO ESTAR LOGUEADO!!");}
    }